package server.Mapper;

import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Author: Hugh
 * @Date: 2020/6/1
 */
public class HostMapper {

    /**
     * key : host
     * val : ContextMapper
     */
    private Map<String, ContextMapper> hostMapper = new ConcurrentHashMap<>();

    public Map<String, ContextMapper> getHostMapper() {
        return hostMapper;
    }

    public void setHostMapper(String host, ContextMapper contextMapper) {
        if(Objects.isNull(hostMapper)){
            hostMapper = new ConcurrentHashMap<>();
        }
        this.hostMapper.put(host, contextMapper);
    }
}
